package work20241207_chap8.r_demo15;

/**
 * @author zdl
 * @date 2024/12/5
 */
public class SalesEmployee extends Employee {
    private double sales;
    private double rate;



    @Override
    public double getSalary(int month) {
        if (this.getMonth() == month) {
            double s = sales * rate;
            return s + 100;
        } else {
            return sales * rate ;
        }

    }

    public SalesEmployee(double sales, double rate) {
        this.sales = sales;
        this.rate = rate;
    }

    public SalesEmployee(String name, int month, double sales, double rate) {
        super(name, month);
        this.sales = sales;
        this.rate = rate;
    }

    public double getSales() {
        return sales;
    }

    public void setSales(double sales) {
        this.sales = sales;
    }

    public double getRate() {
        return rate;
    }

    public void setRate(double rate) {
        this.rate = rate;
    }
}
